package com.fulu.game.bi.controller.market;

import com.fulu.game.bi.common.controller.BaseController;
import com.fulu.game.bi.entity.po.market.NewUserRemainStat;
import com.fulu.game.bi.entity.vo.Result;
import com.fulu.game.bi.entity.vo.market.CommonlyQueryVO;
import com.fulu.game.bi.redis.service.market.NewUserRemainStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 市场、增长 - 新用户留存
 */
@RequestMapping("/api/v1/new-user-remain")
@RestController
public class NewUserRemainStatController extends BaseController {

    @Autowired
    private NewUserRemainStatService newUserRemainStatService;

    /**
     * 新用户留存-列表查询
     */
    @PostMapping("/list")
    public Result<List<NewUserRemainStat>> list(CommonlyQueryVO vo) {
        final List<NewUserRemainStat> list = newUserRemainStatService.list(vo);

        return Result.success().data(list).msg("查询成功");
    }

    /**
     * 新用户留存-导出
     */
    @PostMapping("/export")
    public void export(CommonlyQueryVO vo) {
        newUserRemainStatService.export(vo);
    }

}
